#!/bin/bash

BOLD_WHITE="\033[1;37m"
GREEN="\033[0;32m"
RED="\033[0;31m"
BOLODGREEN="\033[32;01m"
BOLODRED="\033[31;01m"
magenta="\033[0;35m"
BOLDMAGENTA="\033[1;35m"
# cyan
CYAN="\033[0;36m"
# yellow
YELLOW="\033[0;33m"
RESET="\033[0m"


CONF_DIR="conf"
LINK_NAME="service.conf"
LINK_FILE="${CONF_DIR}/${LINK_NAME}"
LOG_FILE="log"
APP_BIN_NAME="stock"
app_name="stockgo"
service_conf="/etc/systemd/system/"
# /etc/supervisor/conf.d/*.conf
supervisor_service_conf="/etc/supervisor/conf.d/"
current_dir="$PWD" # 执行make的目录全路径，可能是软连
# echo "current_dir:$current_dir"
# echo "current_dir:$current_dir" >> /tmp/stock.log

app_root_path=$(basename "$current_dir") # 可能是软连
real_app_root_path=$current_dir  # 即使是软连也在getenv转换为了实际的目录
PID_FILE="${APP_BIN_NAME}.pid"
# shellcheck disable=SC2034
env="default"
real_config_file=""

back_up_dir=""

service_name=""
service_file=""

#damonMode="systemd"
damonMode="supervisor"

testIps="47.93.254.35 , "
prodIps="47.104.12.166 , "

# server_name  test_stockgo_8080
# systemd file  test_stockgo_8080.service
